Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix: add uninstall.sh and update install.sh to modify it during install #24

Closed
wants to merge 7 commits into from

Conversation

densnow
Copy link
Collaborator

@densnow densnow commented Aug 24, 2023

Note: The URL on line 91 has been changed to download from 14-create-uninstallation-scripts instead of main for testing purposes. This will need to be changed back before merging.

Another couple of points:

  • The uninstall script has been added to FILES so will be downloaded if no arg is given. If arg is given install.sh will copy uninstall.sh to the M269 folder. So whichever way the script is run uninstall.sh will end up in the M269 folder; not sure if this is correct based on what the second mode is supposed to be used for.
  • The messaging (echoed to the user) and general comments might need some changes for consistency with the original script and just a better "bedside manner".
  • The script does not delete itself at the end. For the process of reinstallation I think it would make sense to do this?

@densnow densnow linked an issue Aug 24, 2023 that may be closed by this pull request
2 tasks
@densnow densnow force-pushed the 14-create-uninstallation-scripts branch from b9aedc3 to 841898e Compare August 24, 2023 13:31
@densnow densnow force-pushed the 14-create-uninstallation-scripts branch from 841898e to 3a98edb Compare August 24, 2023 16:27
Copy link
Member

@mwermelinger mwermelinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in #14, automatic uninstallation is high effort and low priority because it's just a 'nice to have': manual uninstallation is neither difficult nor time consuming. I don't have now the hours to put into this, so I'm sending this PR back to you but I don't expect further work from you as I won't be able to review.

install.sh Outdated
# Set variables in uninstall.sh
echo "Setting variables into uninstall.sh ..."
sed -i "14iFOLDER=$FOLDER" "$FOLDER/$UNINSTALL"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only tried running install.sh in macOS Big Sur and didn't work. Gives and error on this and the next line and doesn't modify uninstall.sh.
The installed sed doesn't seem to be GNU sed. The -i flag expects (after a space) an extension for the backup. Can be '' to not have a backup. Probably you need to check what POSIX sed allows to be compatible across platforms.
However, both the macOS version and GNU sed expect a backslash after 14i with the text to be inserted in the next line. Maybe you can insert the two lines in one single sed insert command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes looks like macOS uses BSD version of sed whereas Linux (mostly) uses gnu version. It seems like the -i flag in particular works differently on each as you have noted.

I have submitted a possible fix using selection and the $OSTYPE environment variable to see if the script is running on macOS or Linux. It then (hopefully, as I don't have access to mac) uses the appropriate syntax for each version of sed.

I know this is very low priority , so I will just leave it for now until we have more time to test and possibly do more fixes.

@densnow densnow closed this Aug 27, 2023
@densnow
Copy link
Collaborator Author

densnow commented Aug 27, 2023

I am not sure why I did not realise this before, but reading in between (or directly) the lines of Michels comments and picking up the subtle hints. We do not need to introduce code into the main branch at this time (so close to the 23j release) that could potentially break; it is just so unnecessary. Nobody has the time to test this thoroughly at present and the gains are minimal at best.

We can still have the 14-create-uninstallation-scripts branch to work on and hopefully we can get some adventurous 23j students to help test and contribute towards this script. Thanks for you patience Michel 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create uninstallation scripts
2 participants